<template>
  <div class="container">
    <div class="illustration">
      <img src="@/assets/student/index/111.svg" alt="图示" />
    </div>

    <!-- elementplu走马灯 -->
    <el-carousel :interval="5000" height="200px" arrow="hover">
      <el-carousel-item v-for="(item, index) in carouselItems" :key="index">
        <div class="carousel-item-content">
          <div class="card">
            <div class="card-icon">
              <i class="fas fa-user-circle"></i>
            </div>
            <div class="card-content">
              <div class="title">{{ item.title }}</div>
              <div class="subtitle">{{ item.subtitle }}</div>
            </div>
          </div>
        </div>
      </el-carousel-item>
    </el-carousel>

    <div class="history-section">
      <div class="history-title">
        <i class="fas fa-thumbs-up"></i>
        <span>往期对话</span>
      </div>
      <div class="history-item" v-for="n in 3" :key="n">
        <div class="item-header">
          <span class="item-title">英语学习方法</span>
          <div class="item-info">
            <span class="item-date">2024.8.27</span>
            <i class="fas fa-star"></i>
            <span class="item-count">共110条对话</span>
          </div>
        </div>
      </div>
    </div>

    <Sidebar />
  </div>
</template>

<script>
import Sidebar from '@/components/Sidebar.vue';
import { ElCarousel, ElCarouselItem } from 'element-plus';

export default {
  components: {
    Sidebar,
    ElCarousel,
    ElCarouselItem,
  },
  data() {
    return {
      carouselItems: [
        { title: '课后答疑 1', subtitle: '解答你的每一个疑问，AI课后答疑轻松搞定' },
        { title: '课后答疑 2', subtitle: '提升你的学习效率，随时随地进行提问！' },
        { title: '课后答疑 3', subtitle: '我们为你提供最专业的解答支持！' },
      ],
    };
  },
};
</script>

<style scoped>
.container {
  padding: 20px;
  background-color: #ffffff;
}

.illustration {
  text-align: center;
  margin-bottom: 20px;
}

img {
  width: 200px;
  height: 200px;
}

.carousel-item-content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background-color: #ffffff; 
}

.card {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  height: 70%;
  width: 80%;
}

.card-icon {
  background: #e0f7ff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  color: #007bff;
  margin-right: 20px;
}

.card-content .title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 5px;
}

.card-content .subtitle {
  color: #666;
  font-size: 12px;
}

.history-section {
  border-top: 2px solid #007bff;
  margin-top: 20px;
  padding-top: 10px;
}

.history-title {
  display: flex;
  align-items: center;
  font-size: 18px;
  color: #007bff;
  font-weight: bold;
  margin-bottom: 10px;
}

.history-title .fas {
  margin-right: 10px;
}

.history-item {
  display: flex;
  background: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.item-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.item-title {
  font-size: 16px;
  font-weight: bold;
}

.item-info {
  display: flex;
  align-items: center;
}

.item-date {
  font-size: 14px;
  color: #666;
  margin-right: 10px;
}

.item-count {
  font-size: 14px;
  color: #007bff;
  margin-left: 5px;
}
</style>
